﻿<%@ Page Title="" Language="C#" MasterPageFile="~/subpage.master" AutoEventWireup="true" CodeBehind="mytransaction.aspx.cs" Inherits="Nhom14_HTTTHD_BuyMe.mytransaction" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Website Transaction BUY: Watting for payment type</h3>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id" DataSourceID="SqlDataSource1" CellPadding="4" 
        ForeColor="#333333" GridLines="None" ShowHeaderWhenEmpty="True">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="site_name" HeaderText="Name" 
                SortExpression="site_name" />
            <asp:BoundField DataField="site_url" HeaderText="Url" 
                SortExpression="site_url" />
            <asp:BoundField DataField="price" HeaderText="Price" SortExpression="price" />
            <asp:BoundField DataField="total" HeaderText="total" SortExpression="total" />
            <asp:BoundField DataField="payment_type" HeaderText="Payment Type" 
                SortExpression="payment_type" />
            <asp:BoundField DataField="timestamp" HeaderText="Times" 
                SortExpression="timestamp" />
            <asp:TemplateField HeaderText="Action">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" 
                        NavigateUrl='<%# Eval("id", "mytransaction.aspx?id_tran={0}") %>' 
                        Text="choose type" CssClass='<%# Eval("payment_type","Payment_type{0}") %>'  ></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>  
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WebsitebrokenConnection %>" 
        
        
        SelectCommand="SELECT website.site_name, website.site_url, bid_website.price, [transaction].type_bid, [transaction].total, [transaction].payment_type, [transaction].timestamp, [transaction].id, bid_website.id AS Expr1 FROM website INNER JOIN bid_website ON website.id = bid_website.id_website INNER JOIN [transaction] ON bid_website.id = [transaction].id_bid WHERE (bid_website.id_account = @id_account) AND ([transaction].type_bid = 1)">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="id_account" SessionField="user" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
        <table id="typebid" runat="server" visible="false">
            <tr>
                <td>
                    <asp:RadioButton ID="RadioButton1" GroupName="typebid" runat="server" /></td>
                <td>
                    không thông qua BuyMe
                </td>
            </tr>
             <tr>
                <td><asp:RadioButton ID="RadioButton2" GroupName="typebid" runat="server" /></td>
                <td>Thông qua BuyMe</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="idTransac" runat="server" Text="" Visible="false" ></asp:Label>
                </td>
                <td>
                    <asp:Button ID="Button1" runat="server" Text="OK" onclick="Button1_Click" /></td>
            </tr>
        </table>
    <br />
    <h3>Domain Transaction BUY:&nbsp; Watting for payment type</h3>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id" DataSourceID="SqlDataSource2" CellPadding="4" 
        ForeColor="#333333" GridLines="None" ShowHeaderWhenEmpty="True">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="domain_url" HeaderText="Url" 
                SortExpression="domain_url" />
            <asp:BoundField DataField="timestamp" HeaderText="Time" 
                SortExpression="timestamp" />
            <asp:BoundField DataField="price" HeaderText="Price" SortExpression="price" />
            <asp:BoundField DataField="payment_type" HeaderText="Type Payment" 
                SortExpression="payment_type" />
            <asp:BoundField DataField="total" HeaderText="Total" SortExpression="total" />
            <asp:BoundField DataField="timestamp" HeaderText="Time Create" 
                SortExpression="timeTransaction" />
            <asp:TemplateField HeaderText="Action">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" 
                        NavigateUrl='<%# Eval("id", "mytransaction.aspx?idTrand={0}") %>' 
                        Text="choose type" CssClass='<%# Eval("payment_type","Payment_type{0}") %>' ></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WebsitebrokenConnection %>" 
        
        
        
        SelectCommand="SELECT [transaction].id, domain.domain_url, bid_domain.price, [transaction].total, [transaction].type_bid, [transaction].payment_type, [transaction].timestamp, bid_domain.id AS Expr1 FROM bid_domain INNER JOIN domain ON bid_domain.id_domain = domain.id INNER JOIN [transaction] ON bid_domain.id = [transaction].id_bid WHERE (bid_domain.id_account = @id) AND ([transaction].type_bid = 2)">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="id" SessionField="user" />
        </SelectParameters>
    </asp:SqlDataSource>
     <table id="idtypedomain" runat="server" visible="false">
            <tr>
                <td>
                    <asp:RadioButton ID="RadioButton3" GroupName="typebidd" runat="server" /></td>
                <td>
                    Không thông qua BuyMe
                </td>
            </tr>
             <tr>
                <td><asp:RadioButton ID="RadioButton4" GroupName="typebidd" runat="server" /></td>
                <td>Thông qua BuyMe</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="idtrand" runat="server" Text="" Visible="false" ></asp:Label>
                </td>
                <td>
                    <asp:Button ID="Button2" runat="server" Text="OK" onclick="Button2_Click" /></td>
            </tr>
        </table>
    <br/>
    <h3>Website Transaction SELL:</h3>
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id" DataSourceID="SqlDataSource3" CellPadding="4" 
        ForeColor="#333333" GridLines="None" ShowHeaderWhenEmpty="True">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="id_bid" HeaderText="ID Bib" 
                SortExpression="id_bid" />
            <asp:BoundField DataField="site_name" HeaderText="Name" 
                SortExpression="site_name" />
            <asp:BoundField DataField="site_url" HeaderText="Url" 
                SortExpression="site_url" />
            <asp:BoundField DataField="total" HeaderText="Total" SortExpression="total" />
            <asp:BoundField DataField="payment_type" HeaderText="Payment Type" 
                SortExpression="payment_type" />
            <asp:BoundField DataField="status" HeaderText="Status" 
                SortExpression="status" />
            <asp:BoundField DataField="information" HeaderText="Information" 
                SortExpression="information" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" 
                        NavigateUrl='<%# Eval("id", "infotransaction.aspx?id={0}") %>' 
                        Text='update info' CssClass='<%# Eval("status","Status{0}") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WebsitebrokenConnection %>" 
        
        SelectCommand="SELECT [transaction].id, [transaction].id_bid, website.site_name, website.site_url, bid_website.price, [transaction].total, [transaction].payment_type, [transaction].status, [transaction].information FROM website INNER JOIN bid_website ON website.id = bid_website.id_website INNER JOIN [transaction] ON bid_website.id = [transaction].id_bid WHERE (website.id_account = @id_account)">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="id_account" SessionField="user" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:Label ID="Label2" runat="server" Text="Label" Visible="False"></asp:Label>
    <h3>Domain Transaction SELL:</h3>
    <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id" DataSourceID="SqlDataSource4" CellPadding="4" 
        ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="domain_url" HeaderText="Url" 
                SortExpression="domain_url" />
            <asp:BoundField DataField="total" HeaderText="Total" SortExpression="total" />
            <asp:BoundField DataField="type_bid" HeaderText="Type Bid" 
                SortExpression="type_bid" />
            <asp:BoundField DataField="payment_type" HeaderText="Payment Type" 
                SortExpression="payment_type" />
            <asp:BoundField DataField="id_account" HeaderText="ID Account" 
                SortExpression="id_account" />
            <asp:BoundField DataField="status" HeaderText="Status" 
                SortExpression="status" />
            <asp:BoundField DataField="information" HeaderText="Information" 
                SortExpression="information" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" 
                        NavigateUrl='<%# Eval("id", "infotransaction.aspx?id={0}") %>' 
                        Text="update info" CssClass='<%# Eval("status","Status{0}") %>' ></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WebsitebrokenConnection %>" 
        
        SelectCommand="SELECT [transaction].id, domain.domain_url, [transaction].total, [transaction].type_bid, [transaction].payment_type, bid_domain.id_account, [transaction].status, [transaction].information FROM bid_domain INNER JOIN domain ON bid_domain.id_domain = domain.id INNER JOIN [transaction] ON bid_domain.id = [transaction].id_bid WHERE (domain.id_account = @id)">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="id" SessionField="user" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="SidebarContent" runat="server">
    
    <div class="account">
        <h2>
            My Account</h2>
        <ul>
            <li><a href="myhomepage.aspx">My Websites-Domain</a></li>
            <li><a href="mybid.aspx">My Bibs</a></li>
            <li><a href="mytransaction.aspx">My Transaction</a></li>
            <li><a href="mymessage.aspx">My Messages</a></li>
        </ul>
    </div>
</asp:Content>
